import { S } from '../../s';
import { IPSDEAppendParamLogic } from './ipsdeappend-param-logic';
import { IPSDELogic } from './ipsdelogic';
import { IPSDELogicParam } from './ipsdelogic-param';
import { PSDELogicNodeImpl } from './psdelogic-node-impl';

export class PSDEAppendParamLogicImpl
  extends PSDELogicNodeImpl
  implements IPSDEAppendParamLogic
{
  get dstIndex(): number {
    return this.M.dstIndex != null ? this.M.dstIndex : -1;
  }

  protected dstpsdelogicparam: IPSDELogicParam;
  getDstPSDELogicParam(): IPSDELogicParam | null {
    if (this.dstpsdelogicparam != null) return this.dstpsdelogicparam;
    const value = this.M.getDstPSDELogicParam;
    if (value == null) {
      return;
    }
    const ipsdelogic = this.getParentPSModelObject(S._200) as IPSDELogic;
    if (ipsdelogic != null) {
      this.dstpsdelogicparam = ipsdelogic.findPSDELogicParam(value);
    }
    return this.dstpsdelogicparam;
  }

  get srcFieldName(): string {
    return this.M.srcFieldName;
  }

  get srcIndex(): number {
    return this.M.srcIndex != null ? this.M.srcIndex : -1;
  }

  protected srcpsdelogicparam: IPSDELogicParam;
  getSrcPSDELogicParam(): IPSDELogicParam | null {
    if (this.srcpsdelogicparam != null) return this.srcpsdelogicparam;
    const value = this.M.getSrcPSDELogicParam;
    if (value == null) {
      return;
    }
    const ipsdelogic = this.getParentPSModelObject(S._200) as IPSDELogic;
    if (ipsdelogic != null) {
      this.srcpsdelogicparam = ipsdelogic.findPSDELogicParam(value);
    }
    return this.srcpsdelogicparam;
  }

  get srcSize(): number {
    return this.M.srcSize != null ? this.M.srcSize : -1;
  }
  get cls(): string {
    return 'PSDEAppendParamLogicImpl';
  }
  instanceof(cls: string): boolean {
    if (cls == S._3b4) return true;
    return super.instanceof(cls);
  }
}
